package com.store.app.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;

import com.store.app.MainActivity;

/**
 * Created by Administrator on 2016/5/11.
 */
public class UserTokenUtils {
    public static void  setUerToken(Context context){
    if (TextUtils.isEmpty(MainActivity.user_token)) {
        Log.i("mylog","usertoken 重新获取");
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
        String s_user_token = preferences.getString(MainActivity.PREF_USER_TOKEN, null);
        if (!TextUtils.isEmpty(s_user_token)) {
            MainActivity.user_token = s_user_token;
        }
    }
}
}
